package com.elinkway.infinitemovies.bean;

import com.elinkway.infinitemovies.view.DefinitionManager;
import com.lvideo.http.bean.LVideoBaseBean;

import java.util.ArrayList;
import java.util.List;

/**
 * 新流解析信息类
 * <p>
 * Created by wangyemin on 2015/12/7.
 */
public class OutSiteStreamInfo implements LVideoBaseBean {
    private List<OutSiteStreamEntity> streamEntityQueue;
    private boolean isRetry; //是否需要再次调用getStream请求流数据（隔1s重试，且只重试一次）
    private ArrayList<String> allFormatsList;    //ios和android下的所有formats。

    public ArrayList<String> getAllFormatsList() {
        return allFormatsList;
    }

    public void setAllFormatsList(List<String> formatsList) {
        allFormatsList = new ArrayList<String>();
        if(formatsList.contains("NORMAL")){
            allFormatsList.add(DefinitionManager.OUTER_DEF_FORMAT_0);
        }
        if(formatsList.contains("HIGH")){
            allFormatsList.add(DefinitionManager.OUTER_DEF_FORMAT_1);
        }
        if(formatsList.contains("SUPER")){
            allFormatsList.add(DefinitionManager.OUTER_DEF_FORMAT_2);
        }
        if(formatsList.contains("SUPER2")){
            allFormatsList.add(DefinitionManager.OUTER_DEF_FORMAT_3);
        }
        if(formatsList.contains("REAL")){
            allFormatsList.add(DefinitionManager.OUTER_DEF_FORMAT_4);
        }
    }

    public List<OutSiteStreamEntity> getStreamEntityQueue() {
        return streamEntityQueue;
    }

    public void setStreamEntityQueue(List<OutSiteStreamEntity> streamEntityQueue) {
        this.streamEntityQueue = streamEntityQueue;
    }

    public boolean isRetry() {
        return isRetry;
    }

    public void setIsRetry(boolean isRetry) {
        this.isRetry = isRetry;
    }

    @Override
    public String toString() {
        return "OutSiteStreamInfo{" +
                "isRetry=" + isRetry +
                ", streamEntityQueue=" + streamEntityQueue +
                '}';
    }
}
